

package jetbrains.buildServer.server.rest.data.util;

import java.util.List;

public class FilterConditionCheckerUtil {
  public static <T> FilterConditionChecker<T> and(List<FilterConditionChecker<T>> filters) {
    return item -> filters.stream().allMatch(checker -> checker.isIncluded(item));
  }

  public static <T> FilterConditionChecker<T> or(List<FilterConditionChecker<T>> filters) {
    return item -> filters.stream().anyMatch(checker -> checker.isIncluded(item));
  }
}